package com.http;

import android.os.AsyncTask;
import android.util.Log;

public abstract class BaseTask extends AsyncTask<Object, Void, Object> {
	protected NetCallBack callback = null;
	protected Object result = null;
	protected String TAG = this.getClass().getName();;
	protected int FLAG_SUCCESS = 1;
	protected int FLAG_FAILED = 2;
	protected int flag = FLAG_FAILED;
	protected String failedStr = "操作失败";

	@Override
	protected void onPostExecute(Object result) {
		if (callback != null) {

			if (flag == FLAG_SUCCESS) {
				callback.onSuccess(result);

			} else {
				callback.onError(result);
			}
		} else {
			Log.e(TAG, "callback为空了");
		}

	}

	protected void trackError(Exception e) {
		if (e != null) {
		}
	}
}
